#pragma once

#include "Include.h"
#include "EvaluatorFunctions.h"
#include "GomokuPlayer.h"
#include "GomokuBoard.h"
#include "Threat.h"

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)

struct SearchChild
{
	Square Move;
	int HeuristicValue;
	GomokuBoard Board;
};

bool ChildSort(SearchChild child0, SearchChild child1);

class SearchPlayer : public GomokuPlayer
{
	bool m_useAlphaBetaPruning;					// Use Alpha Beta
	EvaluationFunction m_evaluationFunction;	// Static Evaluation Function
	int m_searchDepth;

	bool m_playedFirst;
	int m_playerNum;
	int m_moveNumber;
public:
	SearchPlayer(EvaluationFunction evaluationFunction, int searchDepth = 1, bool alphaBeta = true);
	~SearchPlayer();

	virtual void Play(int player, Board board, Move &move);
};
